import router from './router'
import store from './store'

const whiteList = ['/login']

router.beforeEach((to, from) => {
  if (whiteList.includes(to.path)) {
    return true
  }

  const hasToken = store.getters.token

  if (hasToken) { 
    return true
  }

  return '/login' 

})
